package ferus.tigris.livewallpapers.mechanism;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Point;

public class Bolt implements IView {
	ImagesPool imagesPool = null;
	Point position = new Point();
	Paint paint = new Paint();

	public Bolt(ImagesPool instance) {
		imagesPool = instance;
		paint.setAntiAlias(true);
		paint.setFilterBitmap(true);
		paint.setDither(true);
	}

	@Override
	public void draw(Canvas c) {
		Bitmap image = imagesPool.getBolt();
		c.drawBitmap(image, position.x, position.y, paint);
	}

	@Override
	public void setPosition(Point p) {
		Bitmap image = imagesPool.getBolt();
		position.set(p.x - image.getWidth()/2, p.y - image.getHeight()/2);
	}

	@Override
	public void drawBackground(Canvas c) {
	}

	@Override
	public void drawForeground(Canvas c) {
	}

}
